import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager

#1、打开浏览器 --- 驱动管理
ChromeIns = ChromeDriverManager().install()

#创建谷歌浏览器驱动对象
driver = webdriver.Chrome(service=Service(ChromeIns))

driver.get("https://www.baidu.com")

#查找元素 + 输入文本
#driver.find_element(By.CSS_SELECTOR,"#chat-textarea").send_keys("迪丽热巴")  #连写
ele = driver.find_element(By.CSS_SELECTOR,"#chat-textarea")                 #分开写
ele.send_keys("迪丽热巴")